Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
P

Paolo Mazzon

@Paolo Mazzon
About
Posts
3
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Client Universall App WebApi
    P Paolo Mazzon

    This is the mehod Web api "POST":

    // POST: api/Bustas
    [ResponseType(typeof(Busta))]
    public IHttpActionResult PostBusta(Busta busta)
    {
    if (!ModelState.IsValid)
    {

                return BadRequest(ModelState);
    
                
            }
               
                db.Bustas.Add(busta);
                db.SaveChanges();
            
    
            return CreatedAtRoute("DefaultApi", new 
                         { id = busta.IDBusta }, busta);
        }
    

    putting a breakpoint on this line

    db.Bustas.Add(busta);

    this result is (IDbusta = 3 , NomeCliente = nulll, prezzo = 0)

    Windows API question testing beta-testing json announcement

  • Client Universall App WebApi
    P Paolo Mazzon

    Hello I am trying to load data into a web API with a Universal app, but testing with Fiddler will not come out the data in the correct format This should be the result:

    {"IDBusta":4,"NomeCliente":"Fior","Prezzo":9.0}]

    instead it comes so:

    alue=%7B%22IDBusta%22%3A22%2C%22NomeCliente%22%3A%22fff%22%2C%22Prezzo%22%3A22.0%7D

    this is the class on question:

    public sealed partial class CreateOrUpdate : Page
    {
    bool? create { get; set; }
    public CreateOrUpdate()
    {
    this.InitializeComponent();
    }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            // Must be a request to update
            // Because if the "create" is null or true, 
            // it is to denote that the request is to create a new object
            if (e.Parameter as bool? == false)
            {
                create = e.Parameter as bool?;
                var busta = App.ActiveBusta;
                TextBoxIdBusta.Text = busta.IDBusta.ToString();
                TextBoxNome.Text  = busta.NomeCliente.ToString();
                TextBoxPrezzo.Text = busta.Prezzo.ToString();
    
                actionButton.Content = "Update";
            }
        }
    
        private void Button\_Click(object sender, RoutedEventArgs e)
        {
            if ((sender as Button).Content.ToString() == "Home")
            {
                // Go to default page 
               this.Frame.Navigate(typeof(MainPage));
                return; // and cancel the event.
            }
    
            // Otherwise
            var busta = new Busta
            {
                IDBusta = Convert.ToInt32(TextBoxIdBusta.Text),
                NomeCliente   = TextBoxNome.Text.ToString(),
                Prezzo = float.Parse(TextBoxPrezzo.Text),
        };
    
            using (var client = new HttpClient())
            {
                var content = JsonConvert.SerializeObject(busta);
    
                if (create == null || create == true)
                {
                    // Send a POST
                    Task task = Task.Run(async () =>
                    {
                        var data = new HttpFormUrlEncodedContent(
                            new Dictionary
                            {
                                \["value"\] = content
                            }
                        );
                        await client.PostAsync(App.BaseUri, data);
    
    Windows API question testing beta-testing json announcement

  • UWA SQLite Change PATH
    P Paolo Mazzon

    good morning I'm considering creating a Universal app windows 10 limited to the classic desktop and mobile app CRUD but I wanted to make sure that both devices were using the same database, I wanted to ask if you can change the connection string and indicate a specific directory in the local network. I wanted to avoid making a WebAPI REST. This is the path to change:

    path = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "db.sqlite");

    Thanks in advance for your help

    Windows Development database mobile sqlite sysadmin json
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups