Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8919263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:58:30+00:00 2026-06-15T05:58:30+00:00

I am looking in to using breezejs and have a few questions in terms

  • 0

I am looking in to using breezejs and have a few questions in terms of its capabilities and the best practices that come with it.

  1. Does server side metada have to exist? If I have a non EF WebApi controller do I still have to wrap it with the ProviderContext and implement metadata? If so, what is the format of the metadata?
  2. If I am able to omit metadata on the server side and just implement the queryable actionfilter, can I still write client side code to define the metadata? Where would I find information on how to do this?
  3. I have a server Model class called Job with an id and name, which are simple properties and an object property called Company which points to a server side model class called Company which has an id and name. Job(s) can be confidential (through a boolean IsConfidential property on Job) in which case even though they still have a companyId, that property should not be sent to the client. Instead there should be a server-side computed property called CompanyName (basically Company.Name for non-confidential Jobs and “Confidential” for confidential jobs) that is sent to the client. Admin roled users should be able to see and edit CompanyId but regular users should not be able see or post/put that value. How do you accomplish this in breeze? Does breeze deal well with sending and receiving non-Model ViewModels (less properties and some computed properties)?
  4. Is the source for the source code for the ODataActionFilter something I can use and change for any purpose I want?
  5. How difficult would it be to create WebApi Controllers for something other than EF – maybe like Telerik OpenAccess?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T05:58:32+00:00Added an answer on June 15, 2026 at 5:58 am

    Pawel’s post is correct that you should start by calling

    breeze.config.initializeAdapterInstances

    To actually create the client side metadata you would write something like this. ( A simple example).

    initializeMetadataStore(myEntityManager.metadataStore);
    
    function initializeMetadataStore(metadataStore) {
        var et = new EntityType({
            shortName: "Person",
            namespace: "Sample_WebApi.Models"
        });
        et.addProperty( new DataProperty({
            name: "personId",
            dataType: DataType.Int32,
            isNullable: false,
            isPartOfKey: true,
        }));
        et.addProperty(new DataProperty({
            name: "firstName",
            dataType: DataType.String,
            isNullable: false,
        }));
        et.addProperty(new DataProperty({
            name: "lastName",
            dataType: DataType.String,
            isNullable: false,
        }));
        et.addProperty(new DataProperty({
            name: "birthDate",
            dataType: DataType.DateTime,
            isNullable: true
        }));
        et.addProperty(new NavigationProperty({
            name: "meals",
            entityTypeName: "Meal",
            isScalar: false,
            associationName: "personMeals"
        }));
        metadataStore.addEntityType(et);
    
        et = new EntityType({
            shortName: "Meal",
            namespace: "Sample_WebApi.Models"
        });
        et.addProperty(new DataProperty({
            name: "mealId",
            dataType: DataType.Int32,
            isNullable: false,
            isPartOfKey: true,
        }));
        et.addProperty(new DataProperty({
            name: "personId",
            dataType: DataType.Int32,
            isNullable: false,
        }));
        et.addProperty(new DataProperty({
            name: "dateConsumed",
            dataType: DataType.DateTime,
            isNullable: false,
        }));
        et.addProperty(new NavigationProperty({
            name: "person",
            entityTypeName: "Person",
            isScalar: true,
            associationName: "personMeals",
            foreignKeyNames: ["personId"]
        }));
        et.addProperty(new NavigationProperty({
            name: "dishes",
            entityTypeName: "Dish",
            isScalar: false,
            associationName: "mealDishes",
        }));
        metadataStore.addEntityType(et);
    
        et = new EntityType({
            shortName: "Dish",
            namespace: "Sample_WebApi.Models"
        });
        et.addProperty(new DataProperty({
            name: "dishId",
            dataType: DataType.Int32,
            isNullable: false,
            isPartOfKey: true,
        }));
        et.addProperty(new DataProperty({
            name: "foodName",
            dataType: DataType.String,
            isNullable: false,
        }));
        et.addProperty(new DataProperty({
            name: "servingSize",
            dataType: DataType.Double,
            isNullable: false,
        }));
        et.addProperty(new NavigationProperty({
            name: "food",
            entityTypeName: "Food",
            isScalar: true,
            associationName: "DishFood",
            foreignKeyNames: ["foodName"]
        }));
        metadataStore.addEntityType(et);
    
        et = new EntityType({
            shortName: "Food",
            namespace: "Sample_WebApi.Models"
        });
        et.addProperty(new DataProperty({
            name: "foodName",
            dataType: DataType.String,
            isNullable: false,
            isPartOfKey: true,
        }));
        et.addProperty(new DataProperty({
            name: "calories",
            dataType: DataType.Int32,
            isNullable: false,
        }));
        metadataStore.addEntityType(et);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am looking at using ActionbarSherlock but have one query that's holding me back.
I've been looking at using session_regenerate_id in a login class which I have been
I am looking into using the new SQL Server Express LocalDB (I think it
I am looking at using phonegap to create a mobile app that accesses a
I'm looking into using Assembla for hosted SVN, is it possible to have the
I'm looking at using ASP.NET MVC for a current project but I have some
I am looking into using log shipping in a SQL Server 2005 environment. The
Some of mysql code I have been looking using utf8_slovenian_ci in it, why is
I'm looking at using Ruby savon for SOAP. For purely masochistic reasons I have
I have been looking at using JOGL to create some things and have been

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.