breeze

Can Breeze WebAPI expose ODATA

和自甴很熟 提交于 2019-12-11 13:15:24
问题 Can a Breeeze ApiController support ODATA clients for read-only access, now that Microsoft have added ODATA support for WebAPI? 回答1: We are working on doing exactly this. Hopefully, we should have a release out with this ability within the next two weeks. I will post back here when it is available. 来源: https://stackoverflow.com/questions/15225573/can-breeze-webapi-expose-odata

adding entity from one manager to another in breeze

为君一笑 提交于 2019-12-11 12:16:46
问题 I've created 2 entity managers using the same metadata and want to add some entity from manager1 to manager2. I'm getting an Error: Cannot attach this entity because the EntityType and MetadataStore associated with this entity does not match this EntityManager's MetadataStore. here the function that creates managers: function createLocalManager(servName) { var dataService = new breeze.DataService({ serviceName: servName, hasServerMetadata: false }); var metadataStore = new breeze

Breeze - Create Entity on Server side

限于喜欢 提交于 2019-12-11 10:49:38
问题 I would like to create my breeze entity on the server side rather than using breeze entitymanager.createEntity, so that I can set properties of the entity; I don't want to do this on the client side. SERVER SIDE api controller: [HttpGet] public Foo CreateFoo() { Foo f = new Foo() { PrimaryKey = Guid.NewGuid(), SomeProperty = "XXX"; }; return f; // return _contextProvider.Context.Users.Add(user); TRIED THIS TOO } [HttpGet] public string Metadata() { return _contextProvider.Metadata(); } CLIENT

Breeze Validate Entity and its navigational properties

£可爱£侵袭症+ 提交于 2019-12-11 10:15:17
问题 I am able to validate an entity using the code entity.entityAspect.validateEntity() . However, this does not validate navigation properties. My entiy has one-to-one and one-to-many relationship with out entities. I want to validate both the entity and its navigational properties. How can i do this with breeze? EDIT I have a class public class ClassA{ public int id{get; set;} public List<ClassB> navigationArray{get; set;} } public class ClassB{ public int myClass {get; set;} [Foreign("myClass"

breezejs - How to initiate complex type properties when creating a new Entity

帅比萌擦擦* 提交于 2019-12-11 09:59:03
问题 Suppose there is person type which has some complex properties such as Address and dateOfBirth I created a new Entity of person with this code : newPerson(manager.createEntity("Person",{ id: breeze.core.getUuid() })); How can I initiate the complex type so I can bind it to a blank form? In the breeze doc it says :http://www.breezejs.com/documentation/complextype-properties This is actually slightly incorrect, you can create an ‘unbound’ instance of a complexType with the complexType

EntityManager.createEntity() - Strategies for showing generated ids and default values for user input

故事扮演 提交于 2019-12-11 09:57:47
问题 I have 2 entites with 1:M relationship. Vehicle (Id, RetailPrice, StockOn, VehicleInfoId) and VehicleInfo (Id, Year, Make, Model, ICollection<Vehicle>) Both Ids are user specified (strings) but because Breeze requires unique keys (even if temporary) I have to create entities with id = breeze.core.getUuid() . Furthermore, Year and RetailPrice are set to 0 (Year is an int, RetailPrice is decimal). Once I bind these entities to a "New Vehicle form" these values are immediatelly shown to the user

Calling Breeze setDetached() on an entity removed the getValidationErrors()

我们两清 提交于 2019-12-11 09:33:04
问题 Is it an expected behaviour that the array of validations on the entity is destroy when the entity is detached or if you create an entity and you don't add it to the manager (so it's in a 'detached' state), it doesn't have the validation set on your model ? This is problematic as I am creating a form dynamically with angular and breeze based on the entity selected or created and I need those validations 回答1: Yes, that is correct. A detached entity does not validate property changes because it

Do not allow Expands for specific EntityTypes in Breeze

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 08:37:54
问题 I'm searching for an elegant way to not allow specific EntityTypes to be expanded in BreezeJS. We have a (somewhat) public Web Service that we are exposing, and there are some tables that we don't want to be visible to some consumers of that service. Although we can only expose Web API Methods for those specific tables, consumers of the service could still access those tables by expanding from related tables. Note: I've posted an answer to this question, giving a work-around. However, I'm

OptimisticConcurrencyException

只谈情不闲聊 提交于 2019-12-11 08:28:57
问题 The Optimistic ConcurrencyException is not returned right. I tested this with the breeze ToDo sample and my app. This is what is returned if i provoke a an OptimisticConcurrencyException: {"$id":"1","$type":"System.Web.Http.HttpError, System.Web.Http","Message":"An error has occurred."} The ExceptionType is missing. In debug-mode in VS this works right. 回答1: @sascha - You beat me to it on the <customErrors> thing which works fine if you're running in IIS (see Jimmy Bogard's alternative if you

how to make put / post calls with breeze js

自作多情 提交于 2019-12-11 07:54:17
问题 how can you do put / post calls instead of using entityManager.saveChanges when using breeze js? I basically have a readonly entity that is not being tracked but I need to call a service method that will take a parameter or two and will perform some action. 回答1: It's a good question! For now your best bet would be to bypass the Breeze.saveChanges method and simply use Breeze's ajax adapter directly. Something like this: ajaxImpl = breeze.config.getAdapterInstance("ajax"); ajaxImpl.ajax({ type