public SocialMediaIndicatorComponent(Guid objectRelated, string objectType, string indicatorType, int?userId) { mifnexsoEntities = new MIFNEXSOEntities(); try { if (objectRelated != Guid.Empty) { if (userId != null) { socialMediaIndicator = mifnexsoEntities.SocialMediaIndicators.FirstOrDefault( a => a.ObjectId == objectRelated && a.ObjectType == objectType && a.IndicatorType == indicatorType && a.UserId == userId); } if (socialMediaIndicator == null) { mifnexsoEntities = new MIFNEXSOEntities(); socialMediaIndicator = new SocialMediaIndicator(); socialMediaIndicator.SocialMediaIndicatorId = Guid.Empty; socialMediaIndicator.ObjectId = objectRelated; socialMediaIndicator.UserId = userId; socialMediaIndicator.ObjectType = objectType; socialMediaIndicator.IndicatorType = indicatorType; mifnexsoEntities.SocialMediaIndicators.AddObject(socialMediaIndicator); } } } catch (Exception) { throw; } }
public SocialMediaIndicatorComponent() { mifnexsoEntities = new MIFNEXSOEntities(); socialMediaIndicator = new SocialMediaIndicator(); socialMediaIndicator.SocialMediaIndicatorId = Guid.Empty; mifnexsoEntities.SocialMediaIndicators.AddObject(socialMediaIndicator); }
public SocialMediaIndicatorComponent(Guid guid) { mifnexsoEntities = new MIFNEXSOEntities(); try { if (guid != Guid.Empty) { socialMediaIndicator = mifnexsoEntities.SocialMediaIndicators.FirstOrDefault(a => a.SocialMediaIndicatorId == guid); if (socialMediaIndicator == null) { mifnexsoEntities = new MIFNEXSOEntities(); socialMediaIndicator = new SocialMediaIndicator(); socialMediaIndicator.SocialMediaIndicatorId = Guid.Empty; mifnexsoEntities.SocialMediaIndicators.AddObject(socialMediaIndicator); } } } catch (Exception) { throw; } }