oData WCF service - hide an element -
i'm new wcf. web project has ado.net entity data model (aka ef edmx), has entity container name jobsystementities
.
i've created simple odata wcf data service uses jobsystementities
, , works great:
public class jobservice : dataservice<jobsystementities> { public static void initializeservice(dataserviceconfiguration config) { config.setentitysetaccessrule("jobs", entitysetrights.readsingle); }
however, exposes of properties on job. hide sensitive data, i.e. cost field/property/column of job table.
i posting late, might others.
you can use ignoreproperties attribute http://msdn.microsoft.com/en-us/library/system.data.services.ignorepropertiesattribute.aspx on class.
you have define partial job class in order this. in lines of:
namespace dal.entities { [ignoreproperties("cost")] public partial class job { } }
Comments
Post a Comment