Skip to content

Help ! Error: 42P08: could not determine data type of parameter $1 #87

@EltonRst

Description

@EltonRst

I need help, please !

// DbContext
DadosContexto db = new DadosContexto();

       //Model
          Usuario model = new Usuario() { usu_cod = "LUAN"};

            Usuario user = db.Usuarios.FirstOrDefault(u =>
                (!string.IsNullOrEmpty(model.usu_nom) && model.usu_nom.Equals(u.usu_nom) && model.usu_cod.Equals(u.usu_cod))
                ||
                (!string.IsNullOrEmpty(model.usu_cod) && model.usu_cod.Equals(u.usu_cod))
            );

e1

e2

// Usuario class
Usuario.cs

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Databases.Models
{

    [Table("usucad", Schema ="frota")]
    public partial class Usuario
    {
        public Usuario()
        {
        }

        [Key]
        [StringLength(6)]
        public string usu_cod { get; set; }
        public string usu_nom { get; set; }
        public string usu_super { get; set; }
        public Nullable<short> usu_emp { get; set; }
        public string usu_acedat { get; set; }
        public string usu_aceemp { get; set; }
        public string usu_aceopc { get; set; }
        public string usu_nivel { get; set; }
        public string usu_tiplib { get; set; }
        public string usu_ageati { get; set; }
        public Nullable<int> usu_ultcon { get; set; }
        public string usu_ide { get; set; }
        public string usu_loc { get; set; }
        public string usu_stqsai { get; set; }
        public string usu_stqent { get; set; }
        public string usu_stqaju { get; set; }
        public string usu_stqtra { get; set; }
        public string usuemanom { get; set; }
        public string usuemaema { get; set; }
        public string usuemausu { get; set; }
        public string usuemapas { get; set; }
        public string usu_senepi { get; set; }
        public string usu_sensol { get; set; }
        public Nullable<int> usu_dep { get; set; }
        public Nullable<System.DateTime> usu_dua { get; set; }
        public string usu_grasel { get; set; }
        public string usu_colab { get; set; }
        public string usu_funcod { get; set; }

    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions