breeze

Issues including navigation properties in query

£可爱£侵袭症+ 提交于 2019-12-13 14:13:46
问题 I am using Web API 2 with CORS/Entity Framework 6/Breeze.js from bower for a single page application and the breeze query is not expanding the navigation property. I'll break it down from server to client. // POCOs public class Foo { public int Id { get; set; } public Bar Bar { get; set; } } public class Bar { public int Id { get; set; } public string SomeData { get; set; } } public class FooMap : EntityTypeConfiguration<Foo> { public FooMap() { HasKey(t => t.Id); ToTable("Foo"); Property(t =

Breeze Webapi Update Projections

一世执手 提交于 2019-12-13 07:58:55
问题 Continuing on after my initial WebApi Filtering and paging a projection Dilemma Breeze $filter projections thread I am now trying to update my backend database with little success. Giving the Fact that I am: public IQueryable<ConsigneDTO> Consignees(string refname) { IQueryable<ConsigneDTO> q = this.db.Consignes .Where(x => x.Refname == refname) .Select(f => new ConsigneDTO {Refname = f.Refname, Consignee = f.Consignee, Address1 = f.Address1, Address2 = f.Address2, Address3 = f.Address3});

Breeze.js, Can query a SQL view using Breeze?

谁说我不能喝 提交于 2019-12-13 07:39:56
问题 I am trying to learn about Breeze.js, And it seems that Breeze requires that the back-end object has a PK defined. I my case I am trying to read data from a SQL View. Can Breeze query a SQL view using Breeze? What is the workaround or a better alternative for this. Thanks, 回答1: Yes. My C# Model to SQL views looks exactly the same as those mappings to SQL tables. 回答2: Yes you can. Breeze required PK for two way binding, that is send back modified object to server for save changes. In your case

how to tap into mappingcontext.processAnonType

孤街醉人 提交于 2019-12-13 07:35:36
问题 we use breezejs to get both entities and non entities from the server... for the non entities we would like to mess with the returned objects, specifically we want to set their prototype... after stepping through the breeze code it seems like the perfect spot to do this would be in the function below of the MappingContext... here we have access to "result" which is the object breeze returns to the client and we also have access to the "$type" property of "node". With this information on hand

Knockout Validation on Breeze.js entities

ε祈祈猫儿з 提交于 2019-12-13 07:15:03
问题 I'm trying to get Knockout Validation running on my Breeze.js entities but not having much luck. So currently I'm just trying to get a very basic test working to confirm the approach should work but am stumped as to why this is not even working. Essentially I have something like the following running when the user edits one of my entities in an attempt to register knockout validation on the resulting entity from breeze: dataService.getEntity(selectedRowId()) .then(function(result) {

BreezeJS malformed OData query Url when using “startsWith”

◇◆丶佛笑我妖孽 提交于 2019-12-13 06:29:06
问题 Hello I am trying to execute a query using breezejs 1.3.4 . My query is the following function getContacts() { var query = breeze.EntityQuery .from("Contacts").where("Desc", "startsWith", "P"); return manager.executeQuery(query) .then(getSucceeded).fail(getFailed); } "Desc" is a string property in my "Contacts" C# backend model. Tha problem is that the Query URL is formatted like this .../api/Application/Contacts?$filter=startswith(Desc%2Ctime'P')%20eq%20true The word time is added before "P"

Breeze | datajs - no handler for data

自古美人都是妖i 提交于 2019-12-13 05:47:35
问题 I am new in breeze world, but I want use it in my application. I tried test it with simple ASP.Net Api OData service based on Northwind.sdf database. In DataService project I have a simple controller: [BreezeController] public class CategoriesController : ODataController { readonly EFContextProvider<NORTHWNDContext> contextProvider = new EFContextProvider<NORTHWNDContext>(); [HttpGet] [EnableBreezeQuery] public IQueryable<Category> GetCategories() { return contextProvider.Context.Categories;

breezejs and entity framework validation after updates, but before commit

ε祈祈猫儿з 提交于 2019-12-13 05:32:08
问题 not sure if this is a breeze question or an EF question. I have a SaveChanges map that contains inserts/deletes/updates. I have business rule validations that involve multiple entities and relationships between them, so I can't do the complete validation until I know all the changes. The same validation logic is performed on the client, but I am re-validating on the server. What I am looking for is some way to apply the complete sql batch of updates, but before the transaction is committed I

Ordering Breeze Navigation Collection on an Entity with AngularJs

倖福魔咒の 提交于 2019-12-13 05:04:28
问题 This is vary similar, Sorting Breeze navigation properties except I don't really understand the answer if it does apply. I posted for clarification. I have a complex object called MasterTimeline MasterTimeline -Which has a collection of MasterPhases Which has a collection of MasterMilestones . (side not Milestones also have a collection of Tasks with an order) Here is json [ { "$id": "1", "Id": 6, "Name": "New Construction", "MasterPhases": [ { "$id": "2", "Id": 19, "Name": "Phase 1",

How to fetch new (EntityState.New) entities from server with breezejs

霸气de小男生 提交于 2019-12-13 04:36:47
问题 I have a web services that returns some data, which is then transformed into new entities on the server and then passed to the client, where user can edit them. If he chooses to SaveChanges , the entities should be submitted to the server and inserted into database. I have two problems: When entities are returned to client, Breeze marks them as EntityState.New Breeze expects, that unchanged entities have primary key set. Because none of the returned new entities have the key set (the key