本文整理汇总了C#中SO.SilList.Manager.DbContexts.MainDb.SaveChanges方法的典型用法代码示例。如果您正苦于以下问题:C# MainDb.SaveChanges方法的具体用法?C# MainDb.SaveChanges怎么用?C# MainDb.SaveChanges使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SO.SilList.Manager.DbContexts.MainDb
的用法示例。
在下文中一共展示了MainDb.SaveChanges方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: update
public StateTypeVo update(StateTypeVo input, int? stateTypeId= null)
{
using (var db = new MainDb())
{
if (stateTypeId == null)
stateTypeId = input.stateTypeId;
var res = db.stateTypes.FirstOrDefault(e => e.stateTypeId == stateTypeId);
if (res == null) return null;
input.created = res.created;
// input.createdBy = res.createdBy;
db.Entry(res).CurrentValues.SetValues(input);
db.SaveChanges();
return res;
}
}
示例2: insert
public StateTypeVo insert(StateTypeVo input)
{
using (var db = new MainDb())
{
db.stateTypes.Add(input);
db.SaveChanges();
return input;
}
}
示例3: insert
public BusinessCategoryLookupVo insert(BusinessCategoryLookupVo input)
{
using (var db = new MainDb())
{
db.businessCategoryLookups.Add(input);
db.SaveChanges();
return input;
}
}
示例4: insert
public JobTypeVo insert(JobTypeVo input)
{
using (var db = new MainDb())
{
db.jobTypes.Add(input);
db.SaveChanges();
return input;
}
}
示例5: insert
public OptionTypeVo insert(OptionTypeVo input)
{
using (var db = new MainDb())
{
db.optionTypes.Add(input);
db.SaveChanges();
return input;
}
}
示例6: update
public BusinessCategoryLookupVo update(BusinessCategoryLookupVo input, Guid? businessCategoryLookupId= null)
{
using (var db = new MainDb())
{
if (businessCategoryLookupId == null)
businessCategoryLookupId = input.businessCategoryLookupId;
var res = db.businessCategoryLookups.FirstOrDefault(e => e.businessCategoryLookupId == businessCategoryLookupId);
if (res == null) return null;
input.created = res.created;
// input.createdBy = res.createdBy;
db.Entry(res).CurrentValues.SetValues(input);
db.SaveChanges();
return res;
}
}
示例7: update
public ImageVo update(ImageVo input, Guid? imageId= null)
{
using (var db = new MainDb())
{
if (imageId == null)
imageId = input.imageId;
var res = db.images.FirstOrDefault(e => e.imageId == imageId);
if (res == null) return null;
input.created = res.created;
// input.createdBy = res.createdBy;
db.Entry(res).CurrentValues.SetValues(input);
db.SaveChanges();
return res;
}
}
示例8: update
public ListingVo update(ListingVo input, Guid? listingId= null)
{
using (var db = new MainDb())
{
if (listingId == null)
listingId = input.listingId;
var res = db.listings.FirstOrDefault(e => e.listingId == listingId);
if (res == null) return null;
input.created = res.created;
// input.createdBy = res.createdBy;
db.Entry(res).CurrentValues.SetValues(input);
db.SaveChanges();
return res;
}
}
示例9: update
public PropertyListingTypeVo update(PropertyListingTypeVo input, int? propertyListingTypeId= null)
{
using (var db = new MainDb())
{
if (propertyListingTypeId == null)
propertyListingTypeId = input.propertyListingTypeId;
var res = db.propertyListingTypes.FirstOrDefault(e => e.propertyListingTypeId == propertyListingTypeId);
if (res == null) return null;
input.created = res.created;
// input.createdBy = res.createdBy;
db.Entry(res).CurrentValues.SetValues(input);
db.SaveChanges();
return res;
}
}
示例10: insert
public PropertyListingTypeVo insert(PropertyListingTypeVo input)
{
using (var db = new MainDb())
{
db.propertyListingTypes.Add(input);
db.SaveChanges();
return input;
}
}
示例11: insert
public BusinessServiceTypeVo insert(BusinessServiceTypeVo input)
{
using (var db = new MainDb())
{
db.businessServiceTypes.Add(input);
db.SaveChanges();
return input;
}
}
示例12: insert
public CountryTypeVo insert(CountryTypeVo input)
{
using (var db = new MainDb())
{
db.countryTypes.Add(input);
db.SaveChanges();
return input;
}
}
示例13: update
public JobCategoryTypeVo update(JobCategoryTypeVo input, int? jobCategoryTypeId= null)
{
using (var db = new MainDb())
{
if (jobCategoryTypeId == null)
jobCategoryTypeId = input.jobCategoryTypeId;
var res = db.jobCategoryTypes.FirstOrDefault(e => e.jobCategoryTypeId == jobCategoryTypeId);
if (res == null) return null;
input.created = res.created;
// input.createdBy = res.createdBy;
db.Entry(res).CurrentValues.SetValues(input);
db.SaveChanges();
return res;
}
}
示例14: update
public MemberRoleLookupVo update(MemberRoleLookupVo input, Guid? memberRoleLookupId= null)
{
using (var db = new MainDb())
{
if (memberRoleLookupId == null)
memberRoleLookupId = input.memberRoleLookupId;
var res = db.memberRoleLookups.FirstOrDefault(e => e.memberRoleLookupId == memberRoleLookupId);
if (res == null) return null;
input.created = res.created;
// input.createdBy = res.createdBy;
db.Entry(res).CurrentValues.SetValues(input);
db.SaveChanges();
return res;
}
}
示例15: insert
public ImageVo insert(ImageVo input)
{
using (var db = new MainDb())
{
db.images.Add(input);
db.SaveChanges();
return input;
}
}