public Common.Data.General.Profile GetOrCreateProfile(string userName, int regionId, int platformId) { var profile = new Common.Data.General.Profile(); ProfileStoreAccess storeAccess = new ProfileStoreAccess(_connectionString); profile = TryRetriveProfile(userName, regionId, platformId, storeAccess); if (profile.ProfileGuid == null || profile.ProfileGuid == Guid.Empty) { storeAccess.InsertProfile( userName: userName, regionId: regionId, platformId: platformId); profile = TryRetriveProfile(userName, regionId, platformId, storeAccess); } return(profile); }
private Common.Data.General.Profile TryRetriveProfile(string userName, int regionId, int platformId, ProfileStoreAccess storeAccess) { var profile = new Common.Data.General.Profile(); profile = storeAccess.GetProfile( userName: userName, regionId: regionId, platformId: platformId); return(profile); }