using data.DAO; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace data.Repository { public class SQLGroupRepository : IGroupRepository { public readonly RemoteDatabaseContext dbContext; public SQLGroupRepository(RemoteDatabaseContext remoteDatabaseContext) { dbContext = remoteDatabaseContext; } public bool addGroup(GroupDAO group) { try { dbContext.groups.Add(group); return dbContext.SaveChanges() > 1; } catch (Exception ex) { return false; } } public IEnumerable getAllGroup() { return dbContext.groups.ToList(); } } }