withfield orchard 1.4.2

拈花ヽ惹草 提交于 2019-12-11 13:14:34

问题


I'm new to orchard and am following http://skywalkersoftwaredevelopment.net tutorials.

ContentDefinitionManager.AlterPartDefinition(typeof(AddressPart).Name, p => p
            .Attachable(false)
            .WithField("Name", f => f.OfType(typeof(TextField).Name))
            .WithField("AddressLine1", f => f.OfType(typeof(TextField).Name))
            .WithField("AddressLine2", f => f.OfType(typeof(TextField).Name))
            .WithField("Zipcode", f => f.OfType(typeof(TextField).Name))
            .WithField("City", f => f.OfType(typeof(TextField).Name))
            .WithField("Country", f => f.OfType(typeof(TextField).Name))
            );

 SchemaBuilder.CreateTable("AddressRecord", t => t
            .ContentPartRecord()
            .Column<int>("CustomerId")
            .Column<string>("Type", c => c.WithLength(50))
            );

what does withfield really function in this case? why no createtable stuff to create real table field for addressrecord table ?

where are these "Name", "addressline1" supposed to be saved in database?

Thanks for your reading.


回答1:


It adds fields to the Address part. Fields are lighter weight ways to extend type in Orchard. They do not get stored in their own tables but rather are serialized as XML into a single column. This is why they are easier to create, but harder to query.



来源:https://stackoverflow.com/questions/10773727/withfield-orchard-1-4-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!