示例#1
0
        public int Create(TimeReportServiceModel timeReportModel)
        {
            TimeReportDbModel timeReport = timeReportEntityConverter.Convert(timeReportModel);

            dbContext.Add(timeReport);
            dbContext.SaveChanges();
            return(timeReport.Id);
        }
示例#2
0
        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));
        }