Posts by ebitencourt • 131 points
13 posts
-
0
votes1
answer54
viewsA: Increase field size varchar (existing in database) with Nhibernate
Workable solution, use fluentmigration: public class PessoaMigration : Migration { public override void Down() { } public override void Up() { Alter.Column("cpfcnpj") .OnTable("Pessoa")…
-
0
votes2
answers60
viewsA: Generate Quence for Field
It’s been a while, but I’ll leave it here as I’ve decided to meet my need: protected void SetSequence(string sequenceName, int value) { string sqlQuery = string.Empty; if (value == 0) sqlQuery =…
-
0
votes0
answers23
viewsQ: Nhibernate with list of objects changing objects linked by FK
A Document has a Items list mapped with Cascade all (when saving the document, items must be saved). Each item has a reference to the FK of the previously registered product. When opening the…
-
1
votes0
answers37
viewsQ: Httpselfhost Serialize daughter entities + Session nhibernate
I have the following method: // GET: api/Pedido/5 [ResponseType(typeof(Orcamento))] public IHttpActionResult Get(int id) { using (OrcamentoRepository or = new OrcamentoRepository()) { var orcamento…
-
3
votes1
answer40
viewsQ: Size of the form other than programmed
I created a form, with size 300;300, in it a button with the following code: MessageBox.Show(this.Size.ToString()); The Forms are getting too big for my screen, so that running can be readable. Why…
-
0
votes2
answers60
viewsQ: Generate Quence for Field
It is possible for me to create a quence without changing the field to id? Id(x => x.Id).GeneratedBy.Identity(); Map(x => x.DocumentoNumero); Using this example, I would like to keep a quence…
-
0
votes1
answer157
viewsQ: Inheritance of abstract form
I have a standard form, with a textbox, a search button and a grid; as I intend to use it for several searches, I left an abstract Search() method and at the same time the form as abstract... When…
-
0
votes1
answer656
viewsA: Isession +Nhibernate (no Session or Session was closed)
I used the Idisposable interface and I am controlling the Session in the form: Repository: public class Repository<T> : IDisposable, IRepository<T> where T : class { protected ISession…
-
0
votes1
answer656
viewsQ: Isession +Nhibernate (no Session or Session was closed)
In a Windowsforms project Using Repospository pattern, in a Generic class I have the following method: public IList<T> Listar() { using (ISession session =…
-
4
votes1
answer1938
viewsQ: c# Nhibernate a Different Object with the same Identifier value was already Associated with the Session
I’ve been with that mistake for a while and I can’t find a good solution. Saving objects works normally, but for changes it returns me this message: Additional information: a Different Object with…
-
1
votes1
answer54
viewsQ: Increase field size varchar (existing in database) with Nhibernate
Let’s say that this field with size 11 exists in the database, in several clients.. Map(x => x.CpfCnpj).Not.Nullable().Length(11); And one day I need to increase it to . Length(14). Is there any…
-
2
votes1
answer64
viewsQ: Write file to database with Nhibernate
It is possible to serialize and write file in database with Nhibernate? public virtual File Arquivo { get; set; } He does not let map and did not want to record without using Nhibernate to follow…
-
1
votes1
answer118
viewsQ: Problems with creating not null fields with Fluentnhibernate
I have a problem creating the fields using Fluentnhibernate and Postgres. User class: public class Usuario { public virtual int idUsuario { get; set; } public virtual string nome { get; set; }…