private void ClearCurrentPicturesFromSpeaker(Speaker speaker) { var query = repository.Entities.Where(sp => sp.Speaker.Id == speaker.Id); foreach (var speakerPicture in query) { speakerPicture.CurrentPicture = false; } }
private void AddPictureToRepository(Speaker speaker, HttpPostedFileBase picture) { repository.Add(new SpeakerPicture { CurrentPicture = true, Speaker = speaker, Picture = ReadBytes(picture), ContentType = picture.ContentType, FileName=picture.FileName }); }
public static Speaker Create(string salutation, string firstname, string lastname, string email) { var speaker = new Speaker { Id = Guid.NewGuid(), Salutation = salutation, FirstName = firstname, LastName = lastname, Contact = {EMail = email} }; return speaker; }