public int Create(TimeReportServiceModel timeReportModel) { TimeReportDbModel timeReport = timeReportEntityConverter.Convert(timeReportModel); dbContext.Add(timeReport); dbContext.SaveChanges(); return(timeReport.Id); }
private ToDoService GetToDoService(MsSqlLiteDatabaseContext context, List <ToDoDbModel> toDos) { context.Database.OpenConnection(); context.Database.EnsureCreated(); context.ToDos.AddRange(toDos); context.SaveChanges(); var toDoRepository = new ToDoRepository(context, kernel.Get <IToDoEntityConverter>()); return(new ToDoService(toDoRepository)); }