primeros cambios
This commit is contained in:
@@ -1,9 +1,22 @@
|
||||
using Entidades;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Modelo;
|
||||
|
||||
public class RepositorioPropiedades: RepositorioBase<RepositorioPropiedades>
|
||||
{
|
||||
public IQueryable<Propiedade> ListarPropiedades(){
|
||||
var con = Context;
|
||||
return con.Propiedades.AsQueryable();
|
||||
}
|
||||
|
||||
public bool AñadirPropiedad(){
|
||||
return false;
|
||||
public bool AñadirPropiedad(Propiedade prop){
|
||||
var con = Context;
|
||||
|
||||
int count = con.Propiedades.Count()+1;
|
||||
|
||||
prop.Id = count;
|
||||
prop.Idestado = 1;
|
||||
con.Propiedades.Add(prop);
|
||||
return Guardar(con);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user