"景先生毕设|www.jxszl.com

C# DataContext类代码示例

2023-12-29 17:49编辑: www.jxszl.com景先生毕设
本文整理汇总了C#中DataContext类的典型用法代码示例。如果您正苦于以下问题:C#DataContext类的具体用法?C#DataContext怎么用?C#DataContext使用的例子?这里精选的类代码示例或许可以为您提供帮助。 示例1:SetupAsync publicasyncTaskSetupAsync() { _evnt=newEventViewModel { Title="Titleevent", Description="Testevent", Start="11:00", End="14:27", Date="2016-02-01" }; varuserViewModel=newLoginViewModel { Email="[emailprotected]", Password="useruser", RememberMe=false }; varcontext=newDataContext(); varmanager=newUserManager(newUserStore(context)); varuser=awaitmanager.FindAsync(userViewModel.Email,userViewModel.Password); if(user==null) { awaitmanager.CreateAsync(newUser{Email=userViewModel.Email,UserName=userViewModel.Email},userViewModel.Password); } _calendarController=newCalendarController(context); varmockCp=newMock(); if(user!=null)mockCp.SetupGet(cp=>cp.UserId).Returns(user.Id); _calendarController.CurrentUser=mockCp.Object; varmockAuthenticationManager=newMock(); mockAuthenticationManager.Setup(am=>am.SignOut()); mockAuthenticationManager.Setup(am=>am.SignIn()); _calendarController.AuthenticationManager=mockAuthenticationManager.Object; }
原文链接:http://www.jxszl.com/biancheng/C/556858.html