- informatica San Pedro
- SnapDevelop
- Friday, 30 October 2020 07:52 PM UTC
hi appeon community:
I'm new on C#, mvc and snapdevelop.
i have a stored procedure datawindows with 4 sp' s for CRUD operation. I'm trying to generate the service and controller for this model:
<
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;
using SnapObjects.Data;
using DWNet.Data;
using Newtonsoft.Json;
using System.Collections;
namespace WebAPI1.Models
{
[DataWindow("dw_apiusuario", DwStyle.Grid)]
[Table("Stored Procedure")]
[DwProcedure("roa.sp_api_usuarios_b")]
[DwUpdate(DwUpdateAction.Update, "roa.sp_api_usuario_u")]
[DwUpdateParameter(DwUpdateAction.Update, DwArgumentSource.Column, "rut", "rut", UseOriginal = false, Direction = System.Data.ParameterDirection.Input)]
[DwUpdateParameter(DwUpdateAction.Update, DwArgumentSource.Column, "password", "password", UseOriginal = false, Direction = System.Data.ParameterDirection.Input)]
[DwUpdateParameter(DwUpdateAction.Update, DwArgumentSource.Column, "tipo_usuario", "tipo_usuario", UseOriginal = false, Direction = System.Data.ParameterDirection.Input)]
[DwUpdate(DwUpdateAction.Insert, "roa.sp_api_usuario_i")]
[DwUpdateParameter(DwUpdateAction.Insert, DwArgumentSource.Column, "rut", "rut", UseOriginal = false, Direction = System.Data.ParameterDirection.Input)]
[DwUpdateParameter(DwUpdateAction.Insert, DwArgumentSource.Column, "password", "password", UseOriginal = false, Direction = System.Data.ParameterDirection.Input)]
[DwUpdateParameter(DwUpdateAction.Insert, DwArgumentSource.Column, "tipo_usuario", "tipo_usuario", UseOriginal = false, Direction = System.Data.ParameterDirection.Input)]
[DwUpdate(DwUpdateAction.Delete, "roa.sp_api_usuario_d")]
[DwUpdateParameter(DwUpdateAction.Delete, DwArgumentSource.Column, "rut", "rut", UseOriginal = false, Direction = System.Data.ParameterDirection.Input)]
[DwKeyModificationStrategy(UpdateSqlStrategy.DeleteThenInsert)]
[UpdateWhereStrategy(UpdateWhereStrategy.KeyColumns)]
public class Dw_Apiusuario
{
[PropertySave(SaveStrategy.Ignore)]
[DwColumn("rut")]
public int? Rut { get; set; }
[ConcurrencyCheck]
[StringLength(10)]
[PropertySave(SaveStrategy.Ignore)]
[DwColumn("password")]
public string Password { get; set; }
[ConcurrencyCheck]
[PropertySave(SaveStrategy.Ignore)]
[DwColumn("tipo_usuario")]
public int? Tipo_Usuario { get; set; }
}
}
>
snapdevelop doesn't generate all the methods, i get only Retrieve and Update and doesn't work. i tryed the Datastore and sqlmodelmapper options with no luck.
is there any way to generate the methods that will execute the DWUpdateAction Sp's?
i tried asociating the table to the model, but the datastore.update() modify directly the table data and doesn't execute the update sp.
Regards from Chile
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.