JAAAAO v2
JAAAAO v2
CC#
Created by JAAAAO v2 on 6/6/2024 in #help
I'm having problem making a post in swagger. Its a one to many relationship where "Produto" is one.
https://www.youtube.com/watch?v=GF4Yag8mytc found this video that helped me if someone finds the same problem
18 replies
CC#
Created by JAAAAO v2 on 6/6/2024 in #help
I'm having problem making a post in swagger. Its a one to many relationship where "Produto" is one.
public ICollection<Material>? Materiais { get; set; } = null;
public ICollection<MovimentacaoProduto>? MovimentacoesProdutos { get; set; } = null;
public ICollection<Material>? Materiais { get; set; } = null;
public ICollection<MovimentacaoProduto>? MovimentacoesProdutos { get; set; } = null;
tried to create the class like this, but swagger still have the same request body
18 replies
CC#
Created by JAAAAO v2 on 6/6/2024 in #help
I'm having problem making a post in swagger. Its a one to many relationship where "Produto" is one.
I just wanted to post a "Produto", without needing to create a "Material" or "Movimentacao", but the Swagger API gives me a body request whith all of these.
18 replies
CC#
Created by JAAAAO v2 on 6/6/2024 in #help
I'm having problem making a post in swagger. Its a one to many relationship where "Produto" is one.
Its the first time creating a SQL table thats one to many and im a realy lost, i do not have experience creating one to one either, so yeah.
18 replies
CC#
Created by JAAAAO v2 on 6/6/2024 in #help
I'm having problem making a post in swagger. Its a one to many relationship where "Produto" is one.
but doesnt it mean that the body request will not need those other classes to make a postw
18 replies
CC#
Created by JAAAAO v2 on 6/6/2024 in #help
I'm having problem making a post in swagger. Its a one to many relationship where "Produto" is one.
cool, first time using disc to ask programming questions, will use this for now on
18 replies
CC#
Created by JAAAAO v2 on 6/6/2024 in #help
I'm having problem making a post in swagger. Its a one to many relationship where "Produto" is one.
using System.ComponentModel.DataAnnotations;

namespace micro_crud_be.Models
{
public class Produto
{
[Key]
public int ProdutoId { get; set; }
public string Nome { get; set; }
public int CodigoDeBarras { get; set; }
public int QRCode { get; set; }
public string LocalizacaoAtual { get; set; }
public ICollection<Material>? Materiais { get; set; } = new List<Material>();
public ICollection<MovimentacaoProduto>? MovimentacoesProdutos { get; set; } = new List<MovimentacaoProduto>();

}
}
using System.ComponentModel.DataAnnotations;

namespace micro_crud_be.Models
{
public class Produto
{
[Key]
public int ProdutoId { get; set; }
public string Nome { get; set; }
public int CodigoDeBarras { get; set; }
public int QRCode { get; set; }
public string LocalizacaoAtual { get; set; }
public ICollection<Material>? Materiais { get; set; } = new List<Material>();
public ICollection<MovimentacaoProduto>? MovimentacoesProdutos { get; set; } = new List<MovimentacaoProduto>();

}
}
But this model doesnt request all those things right?
18 replies
CC#
Created by JAAAAO v2 on 6/6/2024 in #help
I'm having problem making a post in swagger. Its a one to many relationship where "Produto" is one.
The problem is that i cant just pass :
{
"produtoId": 1,
"nome": "Cell",
"codigoDeBarras": 110,
"qrCode": 110,
"localizacaoAtual": "Storage",
}
{
"produtoId": 1,
"nome": "Cell",
"codigoDeBarras": 110,
"qrCode": 110,
"localizacaoAtual": "Storage",
}
As a request body to make a post
18 replies