public async Task Like(string userID, int photoID) { var currentLike = await db.LikePhotoes.Where(x => x.UserID == userID).Where(x => x.PhotoID == photoID).ToListAsync(); db.LikePhotoes.RemoveRange(currentLike); LikePhoto newLike = new LikePhoto(); newLike.UserID = userID; newLike.PhotoID = photoID; newLike.Liked = 1; db.LikePhotoes.Add(newLike); await db.SaveChangesAsync(); }
public async Task Save() { await db.SaveChangesAsync(); }
public async Task Log(LogMessage message) { db.LogMessages.Add(message); await db.SaveChangesAsync(); }