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