| 123456789101112131415161718192021222324252627282930313233343536373839 |
- 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<QlbrcDbContext>();
- using (var context = new QlbrcDbContext(options))
- {
- return OnExecute(context);
- }
- }
- protected abstract Result OnExecute(QlbrcDbContext context);
- #endregion
- #region *** Private operations ***
- #endregion
- }
- }
|