public async Task <Network> GetNetworkByPartialNameAsync(ContentURI uri, string partName) { AppHelpers.Networks oNetworkHelper = new AppHelpers.Networks(); Network network = await oNetworkHelper.GetNetworkAsync(uri, partName); return(network); }
public async Task <Network> GetNetworkByIdAsync(ContentURI uri, int id) { AppHelpers.Networks oNetworkHelper = new AppHelpers.Networks(); Network network = await oNetworkHelper.GetNetworkAsync(uri, id.ToString()); return(network); }
public async Task <List <Network> > GetNetworkAsync(ContentURI uri) { AppHelpers.Networks oNetworkHelper = new AppHelpers.Networks(); List <Network> networks = await oNetworkHelper.GetNetworkAsync(uri); return(networks); }
//deprecated in 2.0.0 in favor of uniform EF form edits //public async Task<int> InsertNewClubForMemberAsync(ContentURI uri, string accountName, // string accountEmail, int accountGroupId, int accountGroupGeoRegionId) //{ // int iAccountId = 0; // if (uri.URIMember != null) // { // if (uri.URIMember.Member != null) // { // if (uri.URIMember.Member.PKId != 0) // { // var newAccount = new Account // { // AccountName = accountName, // AccountEmail = accountEmail, // AccountURI = string.Empty, // AccountDesc = string.Empty, // AccountLongDesc = string.Empty, // AccountClassId = accountGroupId, // GeoRegionId = accountGroupGeoRegionId, // GeoRegion = null, // AccountClass = null, // AccountToAddIn = null, // AccountToAudit = null, // AccountToCredit = null, // AccountToLocal = null, // AccountToMember = null, // AccountToNetwork = null, // AccountToPayment = null, // AccountToService = null // }; // //join table (each member can join one or more accounts (clubs)) // var newAccountToMember = new AccountToMember // { // MemberId = uri.URIMember.Member.PKId, // //each member is the coordinator of their own club // MemberRole = AppHelpers.Members.MEMBER_ROLE_TYPES.coordinator.ToString(), // //next step after insertion switches the default club to this club // IsDefaultClub = false, // ClubDefault = null, // Member = null // }; // try // { // _dataContext.Entry(newAccount).State = EntityState.Added; // await _dataContext.SaveChangesAsync(); // newAccountToMember.AccountId = newAccount.PKId; // _dataContext.Entry(newAccountToMember).State = EntityState.Added; // await _dataContext.SaveChangesAsync(); // iAccountId = newAccount.PKId; // //160 // newAccountToMember.Member = new Member(uri.URIMember.Member); // uri.URIMember = newAccountToMember; // } // catch // { // throw; // } // } // } // } // return iAccountId; //} public async Task <Network> GetNetworkByIdAsync(ContentURI uri, int id) { AppHelpers.Networks oNetworkHelper = new AppHelpers.Networks(); Network network = await oNetworkHelper.GetNetworkAsync(uri, id.ToString()); //152 uses ef only to edit content //network = await _dataContext.Network.SingleOrDefaultAsync(x => x.PKId == id); return(network); }
public async Task <Network> GetNetworkByPartialNameAsync(ContentURI uri, string partName) { AppHelpers.Networks oNetworkHelper = new AppHelpers.Networks(); Network network = await oNetworkHelper.GetNetworkAsync(uri, partName); //152 uses ef only to edit content //network = await _dataContext.Network // .FirstOrDefaultAsync(n => n.NetworkURIPartName == partName); return(network); }