public static string CreateMappingXMLFrom( Entity entity, string assemblyName, string entityNamespace, bool autoImport, TopLevelAccessTypes defaultAccess, TopLevelCascadeTypes defaultCascade, bool defaultLazy) { hibernatemapping hm = new hibernatemapping { @namespace = entityNamespace, assembly = assemblyName, autoimport = autoImport }; if (defaultAccess != TopLevelAccessTypes.property) hm.defaultaccess = defaultAccess.ToString(); if (defaultCascade != TopLevelCascadeTypes.none) hm.defaultcascade = defaultCascade.ToString().Replace("_", "-"); if (!defaultLazy) hm.defaultlazy = defaultLazy; EntityMapper mapper = new EntityMapper(); var newClass = mapper.ProcessEntity(entity); hm.AddClass(newClass); return hm.ToXml().Replace(@"xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" ", "").Replace(@"xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" ", ""); }
public static string CreateMappingXMLFrom( Entity entity, string assemblyName, string entityNamespace, bool autoImport, TopLevelAccessTypes defaultAccess, TopLevelCascadeTypes defaultCascade, bool defaultLazy) { hibernatemapping hm = new hibernatemapping { @namespace = entityNamespace, assembly = assemblyName, autoimport = autoImport }; if (defaultAccess != TopLevelAccessTypes.property) { hm.defaultaccess = defaultAccess.ToString(); } if (defaultCascade != TopLevelCascadeTypes.none) { hm.defaultcascade = defaultCascade.ToString().Replace("_", "-"); } if (!defaultLazy) { hm.defaultlazy = defaultLazy; } EntityMapper mapper = new EntityMapper(); var newClass = mapper.ProcessEntity(entity); hm.AddClass(newClass); return(hm.ToXml().Replace(@"xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" ", "").Replace(@"xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" ", "")); }
public static bool DefaultAccess_IsValid(TopLevelAccessTypes value, out string failReason) { failReason = ""; return(true); }