breeze

Angular/Breeze: how to save the data in BreezeController to database directly

橙三吉。 提交于 2019-12-13 00:23:51
问题 This is my breezeController using EF repository: [BreezeController] public class BreezeController : ApiController { private readonly MyRepository _repository; public BreezeController() { _repository = new MyRepository(User); } [HttpPost] [ValidateHttpAntiForgeryToken] public SaveResult SaveChanges(JObject saveBundle) { return _repository.SaveChanges(saveBundle); } [HttpGet] public IQueryable<Compound> Compounds(int id) { var compounds = new List<Compound>(); compounds.add(new Compound() {

Breeze + NHibernate Many-To-One Relation, avoid having to specify relation keys

痞子三分冷 提交于 2019-12-12 20:12:58
问题 The following many to one mapping is working (taken from NorthBreeze): public partial class UserRole { public virtual long ID { get; set; } public virtual long UserId { get; set; } public virtual long RoleId { get; set; } public virtual User User { get; set; } public virtual Role Role { get; set; } } <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="Models.NorthwindIB.NH" assembly="Model_NorthwindIB_NH"> <class name="UserRole" table="`UserRole`" dynamic-update="true" optimistic

Javascript Message Out of Stack Space in IE8

落爺英雄遲暮 提交于 2019-12-12 19:58:05
问题 I'm using Breeze 1.4.1, Internet Explorer 8, and ASP.NET MVC 4 Web API. I received the following message when querying: Query failed: Metadata import failed for localhost:port/breeze/Data/Metadata; Unable to process returned metadata:Out of stack space It works on firefox/chrome. Any suggestions on a workaround? Unfortunately I am stuck with IE8 for production code. 回答1: Have you reviewed the Breeze supported browsers page? It describes certain shims that are necessary if you use IE8. In

Breezejs error when loading an entity with related data

旧时模样 提交于 2019-12-12 19:42:36
问题 I'm no doubt missing something obvious here so perhaps the collective power of the internet can point it out to me. I have a code first database structure, consisting of Users, Groups and a GroupUsers table to link the two (EF can handle n-n relationships itself but breezejs needs the table explicitly https://stackoverflow.com/a/13636530/249813). I'm then trying to load users via Breezejs at the client. This works fine when a user is not a member of any groups, but fails when they are with

Manually applying OData query options using Breeze and still return InlineCount

心不动则不痛 提交于 2019-12-12 14:57:18
问题 I'm using Breeze with a Web API back-end and I am trying to figure out how to properly apply the received OData query options while also trying to return the inlineCount for the given OData query. The reason I'm trying to do this is because I need to hit another datasource and fill in some associated properties on the entity that I'm returning (all while still allowing for paging and sorting). Here's an example of what I'm trying to do: [HttpGet] public QueryResult Reservations(

Save changes to RESTful URLS with Breeze JS

痞子三分冷 提交于 2019-12-12 12:13:48
问题 I'm just getting started with Breeze. I'm not using .Net. I've used the edmunds example to GET data, but now I'm trying to POST data. I've tried using manager.saveChanges() which posts a collection of changes to a "SaveChanges" URL. While this is awesome, I'd prefer to have the option of sending the changes individually to RESTful URLS (ie, updating a todo would POST to todo/:id). Is there any way to configure Breeze to do this? Failing that, is the "SaveChanges" URL customizable? 回答1: We are

Query failed and the error.message is the data

有些话、适合烂在心里 提交于 2019-12-12 10:59:01
问题 A friend's query was failing. Fortunately, he was catching it in his fail callback (you DO have a fail callback for every server call, right?). Here's kind of what he had: var getPersons = function(personsObservable) { return EntityQuery.from('Person') .using(manager).execute() .then(querySucceeded).fail(queryFailed); } function queryFailed(error) { var msg = 'Error retreiving data. ' + error.message; logError(msg, error); throw error; } The error.message simply showed the JSON data ... which

How to Return Extra Data with IQueryable method?

让人想犯罪 __ 提交于 2019-12-12 10:11:10
问题 I am using Entity Framework and Breeze. For an Entity, there is a bit of associated data I would like to provide with the entity. Getting this data is most efficiently done by querying the Entity table and joining to other tables; this query includes a group by sub-query. I am attempting to tack this extra data on by adding it as a [NotMapped] field to the entity: [NotMapped] public string NotMappedField { get; set; } So then I basically want to replace this webapi controller method [HttpGet]

breezejs: overriding displayname

橙三吉。 提交于 2019-12-12 08:06:25
问题 I'm in the process of customizing validation messages. It's working fine using the messageTemplates property. However it uses %displayName% to render the name of the property and I can't find out how to override this value ? Is there anyway to do that ? 回答1: This is not YET well documented but you can simply set the 'displayName' property on any dataProperty and this will override the autogenerated display name and will be used for all validation messages for this property. So var custType =

Deserializing DbGeometry with Newtonsoft.Json

痴心易碎 提交于 2019-12-12 07:48:14
问题 I'm building a SPA using Angular,Breeze and Web API 2 following the approach as outlined by John Papa in his latest PluralSight course. Everything works well and I can pull information, update, insert, delete back to the server. However I'm using Spatial Types, and when I try to update an entity with a spatial type I get the following error An exception of type 'Newtonsoft.Json.JsonSerializationException' occurred in Newtonsoft.Json.dll but was not handled in user code Additional information: