سؤال

I am using Windows Azure Mobile Services in my Windows 8.1 project, What I need is to hide some columns so that they wont generated at run time to the table at Azure DB. I tried searching for this but couldn't find any solutions.

هل كانت مفيدة؟

المحلول

Do you mean you have some properties in your type in the client which you don't want to be sent to the runtime so that they don't become columns in the corresponding table? If this is the case, you can decorate those properties with the [JsonIgnore] property, and they won't be serialized when the client sends the object to the server (via insert or update), and as such the columns won't be created.

Another option is to make the change in the server side itself, by explicitly deleting the properties of the inserted / updated item in the server script. That would have the same effect. This is an example of such an insert script (the update script would be similar):

function insert(item, user, request) {
    delete item.propertyWhichIDoNotWantToBecomeAColumn;
    request.execute();
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top