internal ActivityEntity AddActivity(ActivityEntity newActivity) { newActivity.Id = 1000; _dbContext.Activities.Add(_mapper.Map <Activity>(newActivity)); _dbContext.SaveChanges(); return(newActivity); }
internal void EndAlgoExecution(int algoExeId, int projectExeID) { var execution = _dbContext.ExecutionInfos.First(x => x.Id == algoExeId); execution.EndDate = DateTime.Now; execution.ProjectExecutionId = projectExeID; _dbContext.SaveChanges(); }
public MessageEntity AddNewMessage(string messageTitle, string messageText, string userName) { MessageEntity message = new MessageEntity { CreateDate = DateTime.Now, Title = messageTitle, Context = messageText, UserName = userName }; _dbContext.Messages.Add(_mapper.Map <Message>(message)); _dbContext.SaveChanges(); return(message); }