当前位置: 首页>>代码示例>>C#>>正文


C# DataLoadOptions.LoadWith方法代码示例

本文整理汇总了C#中DataLoadOptions.LoadWith方法的典型用法代码示例。如果您正苦于以下问题:C# DataLoadOptions.LoadWith方法的具体用法?C# DataLoadOptions.LoadWith怎么用?C# DataLoadOptions.LoadWith使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataLoadOptions的用法示例。


在下文中一共展示了DataLoadOptions.LoadWith方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PostRepoInit

 public override void PostRepoInit()
 {
     var options = new DataLoadOptions();
     options.LoadWith<Sat>(s => s.User);
     options.LoadWith<User>(u => u.Tags);
     _repo.LoadOptions = options;
 }
开发者ID:ajglover,项目名称:helloapp,代码行数:7,代码来源:EventController.cs

示例2: GetAlgorithms

    public IEnumerable<DataTransfer.Algorithm> GetAlgorithms(string platformName) {
      roleVerifier.AuthenticateForAnyRole(OKBRoles.OKBAdministrator, OKBRoles.OKBUser);

      using (OKBDataContext okb = new OKBDataContext()) {
        DataLoadOptions dlo = new DataLoadOptions();
        dlo.LoadWith<Algorithm>(x => x.AlgorithmClass);
        dlo.LoadWith<Algorithm>(x => x.DataType);
        dlo.LoadWith<Algorithm>(x => x.AlgorithmUsers);
        okb.LoadOptions = dlo;

        var query = okb.Algorithms.Where(x => x.Platform.Name == platformName);
        List<Algorithm> results = new List<Algorithm>();

        if (roleVerifier.IsInRole(OKBRoles.OKBAdministrator)) {
          results.AddRange(query);
        } else {
          foreach (var alg in query) {
            if (alg.AlgorithmUsers.Count() == 0 || userManager.VerifyUser(userManager.CurrentUserId, alg.AlgorithmUsers.Select(y => y.UserGroupId).ToList())) {
              results.Add(alg);
            }
          }
        }
        return results.Select(x => Convert.ToDto(x)).ToArray();
      }
    }
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:25,代码来源:RunCreationService.cs

示例3: Command_Should_Parse_Correctly

        //[TestMethod()]
        public void Command_Should_Parse_Correctly()
        {
            // ARRANGE
            Character toon = null;
            InventoryItem invItem = new InventoryItem();

            // Get the client's character info
            string charName = "Badass";
            DataLoadOptions dlo = new DataLoadOptions();
            dlo.LoadWith<Character>(c => c.Account);
            dlo.LoadWith<Character>(c => c.Zone);
            dlo.LoadWith<Character>(c => c.InventoryItems);
            dlo.LoadWith<InventoryItem>(ii => ii.Item);
            using (EmuDataContext dbCtx = new EmuDataContext()) {
                dbCtx.ObjectTrackingEnabled = false;
                dbCtx.LoadOptions = dlo;
                toon = dbCtx.Characters.SingleOrDefault(c => c.Name == charName);
            }

            ZonePlayer zp = new ZonePlayer(1, toon, 1, new Client(new System.Net.IPEndPoint(0x2414188f, 123)));

            // ACT
            //zp.MsgMgr.ReceiveChannelMessage("someTarget", "!damage /amount:200 /type:3", 8, 0, 100);
            zp.MsgMgr.ReceiveChannelMessage("someTarget", "!damage", 8, 0, 100);

            // ASSERT
        }
开发者ID:natedahl32,项目名称:EqEmulator-net,代码行数:28,代码来源:ZonePlayerTest.cs

示例4: Details

        public ActionResult Details(int id)
        {
            IPFinalDBDataContext finalDB = new IPFinalDBDataContext();

            DataLoadOptions ds = new DataLoadOptions();
            ds.LoadWith<Work_Package>(wp => wp.Package_Softwares);
            ds.LoadWith<Package_Software>(ps => ps.Software_Requirement);
            finalDB.LoadOptions = ds;

            var pack = (from p in finalDB.Work_Packages
                        where p.id == id
                        select p).Single();

            //var data = from sr in finalDB.Software_Requirements
            //           join ps in finalDB.Package_Softwares
            //           on sr.id equals ps.sr_id
            //           where ps.wp_id == id
            //           select sr;

            //foreach (var ps in data)
            //{
            //    pack.Package_Softwares.Add(new Package_Software()
            //    {
            //        Software_Requirement = ps,
            //        Work_Package = pack
            //    });
            //}

            return View(pack);
        }
开发者ID:Ider,项目名称:SU-Courses,代码行数:30,代码来源:PackageController.cs

示例5: GetAthleteClubByTournament

        public Inti_AthleteClub GetAthleteClubByTournament(Guid athleteId, Guid tournamentId)
        {
            using (var db = new IntiDataContext(_connectionString))
            {
                var dlo = new DataLoadOptions();
                dlo.LoadWith<Inti_AthleteClub>(ac => ac.Inti_Club);
                dlo.LoadWith<Inti_AthleteClub>(ac => ac.Inti_Position);
                dlo.LoadWith<Inti_AthleteClub>(ac => ac.Inti_Athlete);
                db.LoadOptions = dlo;

                var athleteClubs = from ac in db.Inti_AthleteClub
                                   where ac.AthleteGUID == athleteId &&
                                         ac.Inti_Club.TournamentGUID == tournamentId
                                   select ac;

                if(athleteClubs.ToList().Count == 1)
                {
                    var athleteClub = athleteClubs.ToList()[0];

                    return athleteClub;
                }

                if (athleteClubs.ToList().Count > 1)
                {
                    throw new ArgumentException("More than one club for the athlete with id {0} in the same tournament.", athleteId.ToString());
                }
            }

            return null;
        }
开发者ID:supersalad,项目名称:Interntipset,代码行数:30,代码来源:AthleteManagement.cs

示例6: TaskRepository

 public TaskRepository()
 {
     _dataContext = new DataContextDataContext();
     DataLoadOptions dlo = new DataLoadOptions();
     dlo.LoadWith<Task>(t => t.Project);
     dlo.LoadWith<Task>(t => t.Priority);
     _dataContext.LoadOptions = dlo;
 }
开发者ID:stuartleyland,项目名称:GreenPadMvvm,代码行数:8,代码来源:TaskRepository.cs

示例7: GetDefaultDataLoadOptions

 private static DataLoadOptions GetDefaultDataLoadOptions()
 {
     var lo = new DataLoadOptions();
     lo.LoadWith<Document>(c => c.Employee);
     lo.LoadWith<Document>(c => c.Employee1);
     lo.LoadWith<DocumentTransitionHistory>(c=>c.Employee);
     return lo;
 }
开发者ID:jiguixin,项目名称:WF,代码行数:8,代码来源:DocumentHelper.cs

示例8: GetDefaultDataLoadOptions

 private static DataLoadOptions GetDefaultDataLoadOptions()
 {
     var lo = new DataLoadOptions();
     lo.LoadWith<Employee>(c => c.StructDivision);
     lo.LoadWith<EmployeeRole>(c => c.Role);
     lo.LoadWith<Employee>(c => c.EmployeeRoles);
     return lo;
 }
开发者ID:kanpinar,项目名称:unity3.1th,代码行数:8,代码来源:EmployeeHelper.cs

示例9: QuoteManager

 /// <summary>
 /// Quote Manager 
 /// </summary>
 public QuoteManager()
 {
     db = new BizzyQuoteDataContext(Properties.Settings.Default.BizzyQuoteConnectionString);
     var options = new DataLoadOptions();
     options.LoadWith<Quote>(q => q.QuoteItems);
     options.LoadWith<QuoteItem>(qi => qi.Material);
     options.LoadWith<QuoteItem>(qi => qi.Product);
     db.LoadOptions = options;
 }
开发者ID:BizzyQuote,项目名称:BQ2013,代码行数:12,代码来源:QuoteManager.cs

示例10: ModelDataContext

 public ModelDataContext() :
         base(Settings.Default.MyBlogConnectionString, xmlSource)
 {
     var ds = new DataLoadOptions();
     ds.LoadWith<Post>(p => p.Comments);
     ds.LoadWith<Post>(p => p.CategoryLinks);
     ds.LoadWith<PostCategoryLink>(o => o.PostCategory);
     this.LoadOptions = ds;
 }
开发者ID:attila3453,项目名称:alsing,代码行数:9,代码来源:ModelDataContext.cs

示例11: SettingsRepository

        public SettingsRepository()
        {
            var loadOptions = new DataLoadOptions();

            loadOptions.LoadWith<Settings>(s => s.Server);
            loadOptions.LoadWith<Settings>(s => s.Language);
            loadOptions.LoadWith<Settings>(s => s.PhotoResolution);

            _context.LoadOptions = loadOptions;
        }
开发者ID:nokiadatagathering,项目名称:WP7-Official,代码行数:10,代码来源:SettingsRepository.cs

示例12: GetTransits

		public static IEnumerable<Transit> GetTransits(string playerName, string password)
		{
			var db = new DbDataContext();
			var dl = new DataLoadOptions();
			dl.LoadWith<Transit>(x => x.Fleets);
			dl.LoadWith<Fleet>(x => x.FleetShips);
			dl.LoadWith<Transit>(x => x.PopulationTransports);
			dl.LoadWith<Transit>(x => x.Players);
			db.LoadOptions = dl;
			return db.Transits.ToList();
		}
开发者ID:GoogleFrog,项目名称:Zero-K-Infrastructure,代码行数:11,代码来源:FleetLogic.cs

示例13: AnimationList_Loaded

        void AnimationList_Loaded(object sender, RoutedEventArgs e)
        {
            grdAnimations.DataContext = animationManager;

            DataLoadOptions loadOptions = new DataLoadOptions();
            loadOptions.LoadWith<Animation>(a => a.AnimationType);
            loadOptions.LoadWith<Animation>(a => a.Priority);
            loadOptions.LoadWith<Animation>(a => a.SalesDrive);

            DbDataContext.MakeNewInstance(loadOptions);
            animationManager.AllAnimations = null;
        }
开发者ID:ddksaku,项目名称:loreal,代码行数:12,代码来源:AnimationList.xaml.cs

示例14: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int personId = 0;
         if (Request.QueryString["id"] != null && int.TryParse(TamperProofString.QueryStringDecode(Request.QueryString["id"]), out personId))
         {
             Ajancy.Kimia_Ajancy db = new Ajancy.Kimia_Ajancy(Public.ConnectionString);
             DataLoadOptions dlo = new DataLoadOptions();
             dlo.LoadWith<Ajancy.Person>(p => p.DrivingLicenses);
             dlo.LoadWith<Ajancy.Person>(p => p.DriverCertifications);
             dlo.LoadWith<Ajancy.DriverCertification>(dc => dc.DriverCertificationCars);
             dlo.LoadWith<Ajancy.DriverCertificationCar>(dcc => dcc.CarPlateNumber);
             dlo.LoadWith<Ajancy.CarPlateNumber>(cpn => cpn.PlateNumber);
             dlo.LoadWith<Ajancy.CarPlateNumber>(cpn => cpn.Car);
             dlo.LoadWith<Ajancy.Car>(c => c.FuelCards);
             dlo.LoadWith<Ajancy.Car>(c => c.CarType);
             db.LoadOptions = dlo;
             SetPerson(db.Persons.FirstOrDefault<Ajancy.Person>(p => p.PersonID == personId));
             db.Dispose();
         }
         else
         {
             Response.Redirect("~/Default.aspx");
         }
     }
 }
开发者ID:BehnamAbdy,项目名称:Ajancy,代码行数:27,代码来源:DriverInfo.aspx.cs

示例15: MainPage_Loaded

        void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            using (CalendarClassEntitiesDataContext dc = new CalendarClassEntitiesDataContext(App.conexionString))
            {
                App.Context.ListaMateria.Clear();

                DataLoadOptions dl = new DataLoadOptions();
                dl.LoadWith<Materia>(p => p.Recurso);
                dl.LoadWith<Materia>(p => p.Actividads);
                dc.LoadOptions = dl;

                (from m in dc.Materias select m).ToList().ForEach(p => App.Context.ListaMateria.Add(p));
            }
        }
开发者ID:AndresEspinosa,项目名称:WindowsPhoneApplication,代码行数:14,代码来源:MainPage.xaml.cs


注:本文中的DataLoadOptions.LoadWith方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。