本文整理汇总了C#中UserModel.GetUserID方法的典型用法代码示例。如果您正苦于以下问题:C# UserModel.GetUserID方法的具体用法?C# UserModel.GetUserID怎么用?C# UserModel.GetUserID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserModel
的用法示例。
在下文中一共展示了UserModel.GetUserID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public void Create(CreateCommentViewModel model)
{
var userModel = new UserModel();
using (var db = new DBEntitiesProxy())
{
db.COMMENT.Add(new COMMENT()
{
Content = model.Content,
PlaceId = model.PlaceId,
Date = System.DateTime.Now,
UserId = userModel.GetUserID(model.UserEmail)
});
db.SaveChanges();
}
}
示例2: Create
public void Create(CreatePlaceViewModel model)
{
var userModel = new UserModel();
using (var db = new DBEntitiesProxy())
{
var userid = userModel.GetUserID(model.UserEmail);
db.Place.Add(new Place()
{
Name = model.Name,
Content = model.Content,
Photo_URI = model.Photo_URI,
CountryId = model.CountryId,
IsAccepted = false,
UserId = userid,
AddDate = System.DateTime.Now,
Ranking = 1,
ContentPL = model.ContentPL,
ContentPT = model.ContentPT,
});
db.SaveChanges();
}
}