public static TimelogTypeResponse ModelToReponse(TimeLogType model) { if (model == null) { return(null); } return(new TimelogTypeResponse { TimelogTypeId = model.Id, TimelogType = model.Type, Budget = model.Budget }); }
public void Create(TimeLogType timeLogType) { using (var connection = new SQLiteConnection(ConnectionString)) { connection.Open(); using (var context = new ExamDbContext(connection, false)) { context.Set <TimeLogType>().Add(timeLogType); context.SaveChanges(); } } }