breeze

Translating views with HotTowel (Durandal framework) + VS2012

徘徊边缘 提交于 2019-12-20 14:39:57
问题 I develop an ASP.NET MVC solution with Durandal and Breeze. I need to translate frontend to french and dutch. How to proceed with Durandal/knockout? In a classic ASP.NET MVC solution we have the opportunity to have the views rendered server side (thanks to razor). Thanks for your help. 回答1: To expand on Rob's answer of trying the i18n.js plugin for require.js, here's the steps I followed (I'm working off the Durandal starter template in Visual Studio). Download the i18n.js plugin and put it

Non scalar navigation properties are not populating with “nodb” conception

安稳与你 提交于 2019-12-20 07:34:49
问题 I am using Breeze 1.4.8 and trying to have a list of key/values pairs as Navigation properties with "nodb" conception. I have 2 simple models: function configureKeyValuePairDtoType(metadataStore) { var prop; var et = new entityType({ shortName: "KeyValuePairDto", namespace: "DomainClasses.Dtos.Site", autoGeneratedKeyType: AutoGeneratedKeyType.None }); et.addProperty(prop = new DataProperty({ name: "key", dataType: dataType.String, isNullable: false, isPartOfKey: true })); et.addProperty(prop

breezejs: adding referential constraint to an entity type

你说的曾经没有我的故事 提交于 2019-12-20 07:30:58
问题 This is a follow-up question to my previous issue - this one was getting a bit messy and is more related to the Telerik Data Service. The metadata I receive from the server are missing the referential constraints in the association node, although I've set the foreign key attribute on my model . Therefore I was thinking about manually adding these constraints to my entities in the callback of FetchMetadata. Is that possible and can someone provide a simple example on how to do it ? [EDIT] Here

BreezeJS Predicates on 2nd level expanded entities

☆樱花仙子☆ 提交于 2019-12-20 03:39:24
问题 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

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

六眼飞鱼酱① 提交于 2019-12-20 03:12:07
问题 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

MaxExpansionDepth with latest webapi and breeze

不打扰是莪最后的温柔 提交于 2019-12-19 16:23:12
问题 I have recently updated all of my nuget packages to the latest for EF6, breeze 1.4.5, system.web.http.odata 5.0.0.0, and all the other good bits available. Now, with one query that contains an expansion like x.y.z I get an error as follows: A first chance exception of type 'Microsoft.Data.OData.ODataException' occurred in System.Web.Http.OData.dll Additional information: The request includes a $expand path which is too deep. The maximum depth allowed is 2. To increase the limit, set the

Breeze BeforeSaveEntityonly only allows update to Added entities

筅森魡賤 提交于 2019-12-19 05:43:48
问题 Don't know if this is intended or a bug, but the following code below using BeforeSaveEntity will only modify the entity for newly created records (EntityState = Added), and won't work for modified, is this correct? protected override bool BeforeSaveEntity(EntityInfo entityInfo) { var entity = entityInfo.Entity; if (entity is User) { var user = entity as User; user.ModifiedDate = DateTime.Now; user.ModifiedBy = 1; } ... 回答1: The root of this issue is that on the breeze server we don’t have

How can I manually execute Breeze filters in Web Api?

大城市里の小女人 提交于 2019-12-19 04:06:45
问题 I want to use some external server-side logic to modify properties on the results of a query. To do this, I'll need to apply the Breeze query options, modify the result set, and return it. I know essentially how I can apply OdataQueryOptions to my query, but I don't want to miss out on all the things that BreezeJS does that Web Api's OData doesn't. For example, I want to keep inlineCount . How can I do this? Is there some way to hook into Breeze's query modifying code? In case it matters, I'm

knockout validation using breeze utility?

白昼怎懂夜的黑 提交于 2019-12-18 13:38:51
问题 Has anyone written a utility that will convert Breeze metadata (captured from entity framework data attributes) into knockout validation extensions (using knockout.validation)? 回答1: I have made an function that reads the metadata from an entity and adds validation rules. app.domain.indicador = (function () { "use strict"; var constructor = function () {...} var initializer = function indicadorInitializer(entity) { var entityType = entity.entityType; if (entityType) { console.log(entityType);

Breeze.js mixing DTOs and entities

六月ゝ 毕业季﹏ 提交于 2019-12-18 13:35:52
问题 In Ward's article "The Breeze Server: Have It Your Way": The typical business application has a minimum of 200 domain model types. 90+% of the time the shape of the data I'm sending over the wire is the same as the shape of the entity in my business model. ... When the shape of a client entity doesn't align well with the shape of a server-side business entity, I may switch to a DTO for that particular case. This hits the nail right on the head for our application, but what's the best way to