private DBUser GetOwnerData() { if (OwnerId == null || Participents == null) { return(null); } var owner = Participents.FirstOrDefault(x => x.DBUser.Id == OwnerId); return(owner?.DBUser); }
public void Update() { var owner = GetOwnerData(); if (owner != null) { OwnerName = owner.Name; Participents.Remove(Participents.FirstOrDefault(x => x.DBUser == owner)); } AllParticipents = string.Join(",", Participents.Select(x => x.DBUser.Name)); }