public SocialMediaPost CreateSocialMediaPost(SocialMediaPost socialMediaPost) { if (!ctx.SocialMediaPosts.Any(s => s.PostId == socialMediaPost.PostId)) { ctx.SocialMediaPosts.Add(socialMediaPost); ctx.SaveChanges(); return(socialMediaPost); } else { return(null); } }
public Zone CreateZone(Zone zone) { ctx.Zones.Add(zone); ctx.SaveChanges(); return(zone); }
public Settings CreateSettings(Settings settings) { ctx.Settings.Add(settings); ctx.SaveChanges(); return(settings); }
public ChartItemData CreateChartItemData(ChartItemData chartItemData) { ctx.ChartItemDatas.Add(chartItemData); ctx.SaveChanges(); return(chartItemData); }
/// <summary> /// Creates a new instance of an information objects and /// persists it to the database. /// Returns -1 if SaveChanges() is delayed by unit of work. /// </summary> public int CreateInformations(IEnumerable <Information> infos) { ctx.Configuration.AutoDetectChangesEnabled = false; ctx.Informations.AddRange(infos); return(ctx.SaveChanges()); }
public Item CreateItem(Item item) { ctx.Items.Add(item); ctx.SaveChanges(); return(item); }
/// <summary> /// Creates an instance of a user in the database. /// Returns -1 if SaveChanges() is delayed by unit of work. /// </summary> public int CreateUser(User user) { ctx.Users.Add(user); return(ctx.SaveChanges()); }
/// <summary> /// Creates a new subscription and persist that /// subscription to the database. /// Returns -1 if SaveChanges() is delayed by unit of work. /// </summary> public int CreateSubscription(Subscription sub) { ctx.Subscriptions.Add(sub); return(ctx.SaveChanges()); }
public Alert CreateAlert(Alert alert) { ctx.Alerts.Add(alert); ctx.SaveChanges(); return(alert); }
public Platform CreatePlatform(Platform p) { ctx.Platforms.Add(p); ctx.SaveChanges(); return(p); }
/// <summary> /// Persists an item to the database. /// Returns -1 if SaveChanges() is delayed by unit of work. /// </summary> public int CreateItem(Item item) { ctx.Items.Add(item); return(ctx.SaveChanges()); }
public ApplicationUser CreateUser(ApplicationUser user) { ctx.Users.Add(user); ctx.SaveChanges(); return(user); }
public Chart CreateChart(Chart chart) { ctx.Charts.Add(chart); ctx.SaveChanges(); return(chart); }
/// <summary> /// Creates a new instance of a given subplatform in the database /// </summary> public int CreateSubplatform(SubPlatform subPlatform) { ctx.SubPlatforms.Add(subPlatform); return(ctx.SaveChanges()); }
/// <summary> /// Creates a new dashboard and persist that /// to the database. /// Returns -1 if SaveChanges() is delayed by unit of work. /// </summary> public int CreateDashboard(Dashboard dashboard) { ctx.Dashboards.Add(dashboard); return(ctx.SaveChanges()); }