private void Apply(CourseUpdated @event) { Id = @event.Id; Title = @event.Title; Credits = @event.Credits; DepartmentId = @event.DepartmentId; }
public TableEntity UpdateCourse(CourseUpdated @event, TEntity entity) { var model = entity as Course; model.Holes = @event.Holes; model.ImageUri = @event.ImageUri; model.Location = @event.Location; model.Name = @event.Name; return(new ModelTableEntity <Course>( model.PlayerId, model.Id, JsonConvert.SerializeObject(model))); }
public async Task UpdatedAsync(CourseUpdated @event) { await this._unitOfWork.GetRepositoryAsync <CourseEntity>() .UpdateBach(c => c.ID == @event.Id, c => new CourseEntity { Name = @event.Name, CatalogId = @event.CatalogId, CatalogName = @event.CatalogName, CoverUrl = @event.CoverUrl, SignatureId = @event.SignatureId, SignatureName = @event.SignatureName, Intro = @event.Intro, Goal = @event.Goal, }); this._unitOfWork.SaveChanges(); }
async Task Save() { if (String.IsNullOrWhiteSpace(Courses.courseID) && String.IsNullOrWhiteSpace(Courses.staffID) && String.IsNullOrWhiteSpace(Courses.courseName)) { await _pageService.DisplayAlert("Error", "Please enter the ID and Name.", "OK"); return; } if (Courses.id == 0) { await _coursesStore.AddCourse(Courses); CourseAdded?.Invoke(this, Courses); } else { await _coursesStore.UpdateCourse(Courses); CourseUpdated?.Invoke(this, Courses); } await _pageService.PopModalAsync(); }