コード例 #1
0
ファイル: Uow.cs プロジェクト: Anupam-/codaOrder
        public Uow(codaJournal context)
        {
            this._dbContext = context;
            // Do NOT enable proxied entities, else serialization fails.
            //if false it will not get the associated certification and skills when we
            ////get the applicants
            //this._dbContext.Configuration.ProxyCreationEnabled = false;

            //// Load navigation properties explicitly (avoid serialization trouble)
            //this._dbContext.Configuration.LazyLoadingEnabled = false;

            //// Because Web API will perform validation, we don't need/want EF to do so
            //this._dbContext.Configuration.ValidateOnSaveEnabled = false;

            //DbContext.Configuration.AutoDetectChangesEnabled = false;
            // We won't use this performance tweak because we don't need
            // the extra performance and, when autodetect is false,
            // we'd have to be careful. We're not being that careful.
        }
コード例 #2
0
        public object FindSubject(string searchText)
        {
            string json = string.Empty;
            object results;

            using (var db = new codaJournal())
            {
                string className = "Subject";
                string fieldName = string.Empty;
                long   parentID  = 8000000000180;
                searchText = searchText ?? string.Empty;
                results    = ((codaJournal)this.dbContext).FindObject(className, fieldName, parentID, searchText, false, 10, null);
                //json = JsonConvert.SerializeObject(results);

                // not array
                //Dictionary<string, string> dict = new Dictionary<string, string>();
                //dict.Add("data", json);
                //json = JsonConvert.SerializeObject(dict);
            }

            //return json;
            return(results);
        }