protected bool BasicSetToContract(object target, FKModel fk)
        {
            if (fk.Type != typeof(as_contragents) ||
                target.GetType() != typeof(as_contractDocs))
            {
                return(false);
            }
            var basic = new as_docBasics()
            {
                as_contragent = new as_contragents()
            };

            DataHelper.TrySetValByRefl(target, "as_docBasic", basic);
            return(true);
        }
        public ModelDescriptor(Type typeToInspect)
        {
            entityType = typeToInspect;
            CheckInModelType(entityType, null);
            var toRegisterThis = !_descriptors.ContainsKey(typeToInspect);

            if (toRegisterThis)
            {
                _descriptors.Add(typeToInspect, this);
            }

            if (entityType == typeof(as_contractDocs))
            {
                ForeignKeys    = new FKModel[1].Concat(ForeignKeys).ToArray();
                ForeignKeys[0] = new FKModel()
                {
                    Name = "as_contragents", Type = typeof(as_contragents)
                };
            }
        }