本文整理汇总了C#中SO.SilList.Manager.DbContexts.MainDb.Entry方法的典型用法代码示例。如果您正苦于以下问题:C# MainDb.Entry方法的具体用法?C# MainDb.Entry怎么用?C# MainDb.Entry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SO.SilList.Manager.DbContexts.MainDb
的用法示例。
在下文中一共展示了MainDb.Entry方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
}
示例2: 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;
}
}
示例3: 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;
}
}
示例4: 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;
}
}
示例5: 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;
}
}
示例6: 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;
}
}
示例7: 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;
}
}
示例8: update
public CarVo update(CarVo input, Guid? carId= null)
{
using (var db = new MainDb())
{
if (carId == null)
carId = input.carId;
var res = db.cars.FirstOrDefault(e => e.carId == carId);
if (res == null) return null;
input.created = res.created;
// input.createdBy = res.createdBy;
db.Entry(res).CurrentValues.SetValues(input);
db.SaveChanges();
return res;
}
}