Beispiel #1
0
 public async Task <List <Model> > GetAllAsync()
 {
     using (var ctx = new ModelsDataContext())
     {
         return(await ctx.Models.ToListAsync());
     }
 }
Beispiel #2
0
 public List <Model> GetAll()
 {
     using (var ctx = new ModelsDataContext())
     {
         return(ctx.Models.ToList());
     }
 }
Beispiel #3
0
 public void Add(Model obj)
 {
     using (var ctx = new ModelsDataContext())
     {
         ctx.Models.Add(obj);
         ctx.SaveChanges();
     }
 }
Beispiel #4
0
 public void CleanData()
 {
     using (var ctx = new ModelsDataContext())
     {
         ctx.Models.RemoveRange(ctx.Models.ToList());
         ctx.SaveChanges();
     }
 }
Beispiel #5
0
 public TokenAuthenticationHandler(
     IOptionsMonitor <AuthenticationSchemeOptions> options,
     ILoggerFactory logger,
     UrlEncoder encoder,
     ISystemClock clock,
     ModelsDataContext context)
     : base(options, logger, encoder, clock)
 {
     _context = context;
 }
Beispiel #6
0
 public StatisticsController(IMapper mapper, ModelsDataContext modelsContext)
     : base(mapper, modelsContext)
 {
 }
Beispiel #7
0
 public AnswersController(IMapper mapper, ModelsDataContext modelsContext, AnswersHandler answersHandler)
     : base(mapper, modelsContext)
 {
     _answersHandler = answersHandler;
 }
 public UsersController(IMapper mapper, ModelsDataContext modelsContext)
     : base(mapper, modelsContext)
 {
 }
Beispiel #9
0
 public AnswersHandler(ModelsDataContext context)
 {
     _context = context;
 }
Beispiel #10
0
 public QuestionsController(IMapper mapper, ModelsDataContext modelsContext)
     : base(mapper, modelsContext)
 {
 }
 protected CustomControllerBase(IMapper mapper, ModelsDataContext modelsContext)
 {
     Mapper        = mapper;
     ModelsContext = modelsContext;
 }