using Quadarax.Application.QLiberace.Base; using Quadarax.Foundation.Core.QConsole.Command.Base; using Quadarax.Foundation.Core.QConsole; using Quadarax.Foundation.Core.Value; using Microsoft.EntityFrameworkCore; namespace Quadarax.Application.QLiberace.Console.Commands.Base { internal abstract class DbContextCommand : AbstractCommand { #region *** Properties *** #endregion #region *** Constructor *** public DbContextCommand(Engine engine) : base(engine) { } #endregion #region *** EXECUTE *** protected override Result OnExecute() { var options = new DbContextOptions(); using (var context = new QlbrcDbContext(options)) { return OnExecute(context); } } protected abstract Result OnExecute(QlbrcDbContext context); #endregion #region *** Private operations *** #endregion } }