Closed agorota closed 3 years ago
To create breeze sharp entities and interfaces run https://github.com/enkodellc/blazorboilerplate/tree/master/src/Utils/BlazorBoilerplate.EntityGenerator
Also you don't have to create tables manually in db, you have to use EF migrations. https://blazor-boilerplate.readthedocs.io/en/latest/quickstarts/entity_framework_core.html
If I have to manage a new table why should I migrate? Migrations from what? I do not understand... to manage a new table with Breeze could you tell me the basic steps to follow?
Thank you
Migration is the process to update database with changes you made to Entity Framework entities. So you do not have to manually update db. Steps: Create new EF entity Update db with a migration Run Generator to create the new Breeze entity
Where should I create new EF entity?
Thanks, I've made some progress ... created EF entity as follows:
**namespace BlazorBoilerplate.Infrastructure.Storage.DataModels { [Permissions (Actions.Delete)] public partial class Todotest: IAuditable, ISoftDelete { [Key] public long Id {get; set; }
[Required (ErrorMessage = "FieldRequired")]
[MaxLength (128)]
public string Title {get; set; }
public bool IsCompleted {get; set; }
}
}**
At this point I ran both the migration and the run generetor. It created me tables and related code. By loading the clone of the ToDo razor page appropriately referenced on the new table I can update new rows but it does not populate the list on the screen. i just get it displays the following error:
"Unexpected character encountered while parsing value: <. Path '', line 0, position 0."
in "var result = await apiClient.GetToDoTests ();"
Now works, was missing in ApplicationController this:
[AllowAnonymous]
[HttpGet]
public IQueryable
great job this BlazorBoilerPlate with Breeze.Sharp And thanks for the assistance!
Hi, I'm trying Breeze.Sharp starting from the ToDo example, I created a new table manually in the default database BlazorBoilerplate:
New Table: [Customer]
I created ICustomer in BlazorBoilerplate.Shared.DataInterfaces
public interface ICustomer { Guid customer_id {get; set; } String customer {get; set; } String description {get; set; } }
I created the Customer class in BlazorBoilerplate.Shared.Dto.Db
**public partial class Customer: BaseEntity, ICustomer { public Guid customer_id { get {return GetValue (); }
set {SetValue (value); }
}
I added in IApiClient BlazorBoilerplate.Shared.Interfaces
Task <QueryResult> GetCustomers ();
I added in BlazorBoilerplate.Shared.Services ApiClient.cs public async Task <QueryResult> GetCustomers ()
{
return await GetItems (from: "Customer", orderByDescending: i => i.customer);
}
After that I doubled the TodoList.razor by modifying it appropriately for the new table ...
but I can't get data in var result = await apiClient.GetCustomers ();
Do I need anything else to consume data with Breeze.Sharp?
Thanks