breeze

BreezeJS: Applying Client Query in Controller

守給你的承諾、 提交于 2019-12-02 07:04:56
问题 Is there anyway to apply the user query in the controller in order to perform some actions to the final result set? Take the following example: [HttpGet] public IQueryable<Container> Containers(bool populate) { var containers = _contextProvider.Context.Containers; if (populate) { foreach (var container in containers) { container.Populate(_contextProvider.Context); } } return containers; } The problem here is that I am doing this Populate() action to all records in this table instead of just

breeze: why inheriting from Breeze.Sharp.BaseEntity?

99封情书 提交于 2019-12-02 05:28:01
问题 We've started considering using BreezeSharp as we have a WebAPI ODATA Service that we'd like to re-use with a ASP.NET site (no javascript involved, just pure C#). Unfortunately, we just noticed that, according to the documentation, all of our model entities should now inherit from Breeze.Sharp.BaseEntity. That's a no go for us as this would mean having a dependency on Breeze in our business model. We'd rather keep this dependency on the WebAPI service only. Is there anyway we could avoid this

breezejs: navigation property not added to entity

天大地大妈咪最大 提交于 2019-12-02 04:37:27
I've configured my WebAPI ODATA service (using 5.0.0-rc1 for $expand and $select support) and everything seems to work fine but navigation properties. The metadata does contain my navigation property (OpenPositions on Mandate) : Then my breeze query is the following: function search() { var query = breeze.EntityQuery.from("Mandates").expand("OpenPositions").inlineCount(); return manager.executeQuery(query.using(service)).then(function (result) { logger.info(result); }).fail(function (error) { logger.error(error); }); } The WebAPI controller : [Queryable(AllowedQueryOptions= AllowedQueryOptions

breezejs: navigation property is created but not filled with data

 ̄綄美尐妖づ 提交于 2019-12-02 04:03:38
问题 I'm having yet another issues with navigation properties but this time my configuration is WCF Data Service + EF. Basically the metadata looks good, I have the referential constraints, association, etc... I've set the [ForeignKey] attribute in the model. The navigation property is created on the client-side, but when data is retrieved (using $expand), the collection is not filled although data is definitely returned by the server : The association here is between mandate_id on OpenPosition

BreezeJS Predicates on 2nd level expanded entities

二次信任 提交于 2019-12-02 02:03:43
A similar question has been asked on this matter: Breeze work-around for multi valued property queries Well, that works for one-one-many. i.e parent entity may have one child which in turn has many children. My scenario is : A product has many units, a particular unit has many barcodes. var predicateBarcode = Predicate.create('units.barcodes','any','barcode', 'eq', searchText()); var query = EntityQuery.from('Products') .expand('units.barcodes') // .take(10) .where(predicateBarcode ); return manager.executeQuery(query) .then(querySucceeded) .fail(queryFailed); Executing the Query gives an

Difference between “Q” and “q” in angularjs and requirejs

不打扰是莪最后的温柔 提交于 2019-12-02 01:59:57
I am creating a single page app built on AngularJS, Breeze, and RequireJS. In setting up AMD with requirejs to work with Angular and Breeze, I encountered an issue with Breeze's dependency on "q". If the configuration rule for "q" is lowercase, even if there is no explicit export in the "shim", Breeze gives this error: Uncaught Error: Unable to initialize Q. See https://github.com/kriskowal/q "http://localhost:1498/Scripts/shared/breeze.js"breeze.js:1` When require config changes all references from "q" to "Q" (even without the export), the code works. Does anyone know why this is happening?

Breeze filtering .Expand on server side

只愿长相守 提交于 2019-12-01 23:16:09
I'm trying out BreezeJS . There is a requirement that I can use .expand in the client side code, but based on the role of the user, the server side will not return all the records for the .expand requested type. I tried to create a custom BreezeQueryable attribute and override a method to completely filter out the extra data first just to try. But it threw an exception. I don't see any entry point where I can do that on the server side. Please guide me in the right direction, or let me know if that's not possible. I only have access to generic IQueryable , how do I perform queries on this?

CORS using asp.net web api 2 odata and breeze

拥有回忆 提交于 2019-12-01 23:01:23
I have problem consuming my OData with Breeze. My api is hosted on another server, and I'm using asp.net web api 2.0 (which comes with VS 2013 preview). I know web api is properly configured for CORS, because I've tested it without breeze, and it worked fine. Here is web api 2.0 code which enables CORS: var cors = new EnableCorsAttribute("http://localhost:7122/", "*", "*"); config.EnableCors(cors); Here is my IEdmModel private static IEdmModel CreateModel() { var modelBuilder = new ODataConventionModelBuilder {Namespace = "Test.Domain.Model"}; modelBuilder.EntitySet<MuscleGroup>("MuscleGroup")

Using a dynamic connection string with the Breeze EFContextProvider

早过忘川 提交于 2019-12-01 22:21:01
问题 At the moment i have an application (web/silverlight) where the connectionstring for my ObjectContext is dynamic. It is based on how a user logs in because each of my customers have their own database. ie.. username@domain. I'm trying to find a way to use the EFContextProvider which would be by either passing the ObjectContext through the constructor, or by overriding the GetConnectionString, which sadly both aren't supported. Is there a way to accomplish this, or can i download the source

Using a dynamic connection string with the Breeze EFContextProvider

时光怂恿深爱的人放手 提交于 2019-12-01 21:22:12
At the moment i have an application (web/silverlight) where the connectionstring for my ObjectContext is dynamic. It is based on how a user logs in because each of my customers have their own database. ie.. username@domain. I'm trying to find a way to use the EFContextProvider which would be by either passing the ObjectContext through the constructor, or by overriding the GetConnectionString, which sadly both aren't supported. Is there a way to accomplish this, or can i download the source for the EFContextProvider somewhere so i can implement it myself ? Thanks in advance. This question was