Home How to add a value to a class if the class contains LIST<class>
Reply: 0

How to add a value to a class if the class contains LIST<class>

user1072
1#
user1072 Published in June 23, 2018, 8:03 am

I have a class graf.

public class Graf
    {
        public List<Point> first { get; set; }
        public List<Point> second { get; set; }
}

This class contains List

public class Point
    {
        public int x { get; set; }
        public int y { get; set; }


        public Point(int x, int y)
        {
            this.x = x;
            this.y = y;
        }
    } 

I need to add a Point into class Graf from index.cshtml:

@model WebApplication2.Models.Graf
<table>
        <tr>
            <td></td>
            <td>
                <div class="item">
                    <label>Y</label>
                    <input name="Y11" value="@Model.first" />  --------??
                </div>
            </td>
        </tr>
</table>
    <input type="submit" value="Send" />

But i dont now how i can input into Graf class Point?

How can I do it?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.301005 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO