public void Create(DalLike e) { User user = context.Set<User>().FirstOrDefault(u => u.Login == e.Login); Photo photo = context.Set<Photo>().FirstOrDefault(p => p.Id == e.PhotoId); user.Profile = null; Like like = new Like { User = user, Photo = photo }; if (context.Set<Like>().FirstOrDefault(l => l.Photo.Id == photo.Id && l.User.Id == user.Id) == null) context.Set<Like>().Add(like); }
public void Update(DalLike entity) { throw new NotImplementedException(); }
public void Delete(DalLike e) { throw new NotImplementedException(); }